Replication Archive for "City Limits to Polarization in the American Public," by Amalie Jensen, William Marble, Kenneth Scheve, and Matthew Slaughter. 

The replication archive has two "master" scripts that run all the analyses in the paper: 00master1.do and 01master2.R. They output log files Output/Results1.smcl and Output/Results2.txt, respectively. All the figures are saved to the Output folder. 

00master1.do -- a Stata file that runs the analysis for Figures 1 through 3 in the main text, Figures A-1 through A-4 in the appendix, and Tables A-1 through A-6 in the appendix. It requires one manual step (fixing some unicode errors in a text editor). Instructions for completing this are in the do-file. We have included a cleaned version of the file so this step is not necessary for the replication archive to run. This whole script runs relatively quickly. 

01master2.R -- an R file that runs the hierarchical conjoint analysis and makes Figures 4 and 5 in the main text, Table 2 in the main text, and all the regression tables in Appendix F. The hierarchical model, which is implemented in Stan and called in this script, takes a very long time to run -- over 2 days for us. It outputs a very large stanfit object, saved (with a few other things) in Output/demos_socioecon_pid7_full_sample.rdata. This file is about 11GB large. Unfortunately putting it in a zip archive doesn't actually make it any smaller, since it's mainly a list of real numbers (draws from the posterior). This file is not included in the replication archive but can be downloaded from https://www.dropbox.com/s/2up5juc3jwuxr6i/demos_socioecon_pid7_full_sample.rdata?dl=0. 

Files included:
Data/STAN0107_OUTPUT_8msas.dta -- Raw survey results.
Data/Eight City Survey Questionnaire January__10_2018_YouGov_pub.pdf -- Survey questionnaire.
Data/q63_clean.txt -- Cleaned word count data for no manual editing is needed. See 00master.do for details.
Output/Results1.smlc -- Log fle for 00master1.do.
Output/Results2.txt -- Log file for 01master2.do. 
Output/fig* -- Paper figures in pdf and eps format.
Output/Tables/* -- tex files with tables. 
Output/Original/* -- Figures with more descriptive names. 
Output/extras/* -- Includes traceplots to assess convergence.

Note: because we estimate the hierarchical model via MCMC, the results may not be exactly the same due to simulation error. 

If you have questions, contact Will Marble at wpmarble@stanford.edu. 